package com.first.nell.data

data class RevObjHomeCredit(
    /** 是否为新客 */
    val newUserFlag: String?,
    /** 额度列表 */
    val limit: List<DataHomeCredit>?,
    /** currency */
    val currency: String?,
) {
    fun fetchLastCredit(): DataHomeCredit? {
        limit?.let {
            it.forEach { item ->
                if (this.currency?.isNotBlank() == true) {
                    item.currency = this.currency
                }
            }
            if (it.isNotEmpty()) {
                return it.last()
            }
        }
        return null
    }
}